from abc import ABC, abstractmethod


class Car(ABC):
    @abstractmethod
    def drive(self):
        pass


class SportsCar(Car):
    def drive(self):
        return 'SportsCar driving!'


class TruckCar(Car):
    def drive(self):
        return 'Truck driving!'


class Creator(ABC):
    @abstractmethod
    def create_car(self):
        pass


class SportsCreator(Creator):
    def create_car(self):
        return SportsCar()


class TruckCreator(Creator):
    def create_car(self):
        return TruckCar()


# 客户端代码
creator = SportsCreator()
car = creator.create_car()
print(car.drive())

"""
SportsCar driving!
"""